/* globals App */
var util = require('./libs/util.js');
App({
    onLaunch(event) {
        var _this = this;
        // 用户信息
        swan.getUserInfo({
		    success: function (res) {
		        _this.globalData.userInfo = res.userInfo;
		    }
		});
        // 获取站点信息
        util.request({
            url: 'site.site/detail',
            method: 'POST',
            data: {},
            success: function (res) {
                if(res.code == 200) {
                    _this.globalData.site = res.result;
                }else{
                    swan.showToast({
					    title: res.message,
					    icon: 'none',
					    duration: 1500,
					});
                }
            }
        });
    },
    onShow(event) {
        
    },
    globalData: {
        site: {},               // 站点信息
        userInfo: {},			// 当前用户信息
    }
});
